import { del, get, post, put } from '@/utils/request';

// 用户登录
// export const login = async (params: any): Promise<any> => {
// 	return post('/api/auth/user/signIn', params);
// };

// 只查询当前管理员地区的用户
export const getCurrent = async (params: any): Promise<any> => {
	return await get('/api/user/skip', params);
};

// 新增用户
export const add = async (params: any): Promise<any> => {
	return await post('/api/auth/user/signUp', params);
};

// 批量删除管理员
export const deleted = async (params: number[]): Promise<any> => {
	return await del('/api/user/delete', params);
};

//  update
export const update = async (params: any): Promise<any> => {
	return await put('/api/user', params);
};

// 查询当前地区的所有的用户
export const findall = async (params: any): Promise<any> => {
	return await get('/api/user/findall', params);
};

// 根据ID获取用户ID
export const getInformationById = async (userId: any): Promise<any> => {
	return await get(`/api/user/${userId}`);
};

export const updatePasswordUser = async (id: number, params: any): Promise<any> => {
	return await put(`/api/user/update_password/${id}`, params);
};
